// PartPoint.h: interface for the PartPoint class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PARTPOINT_H__C51C90C7_6829_4A05_A823_64C82A4A5EA7__INCLUDED_)
#define AFX_PARTPOINT_H__C51C90C7_6829_4A05_A823_64C82A4A5EA7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "AutoCADModelObserver.h"
#include "Part.h"
class SHPoint;

class PartPoint : public AutoCADModelObserver  
{
public:
	PartPoint();
	virtual ~PartPoint();

public:
	BOOL Create(const AcDbHandle& handle, Part* pPart);

	BOOL WriteXData();

	virtual void Erase();
	virtual void UnErase();
	virtual void Update(BOOL bUpdate = FALSE);

	void SHObserver(SHPoint* pPt){
		m_pSHPt = pPt;
	}

	SHPoint* SHObserver() const {
		return m_pSHPt;
	}

	virtual void SetDicHandle(const Dictionary& handle);
	virtual AutoCADModelObserver& operator=(const AutoCADModelObserver& other);
private:
	AcDbHandle NewPipeEntity(Part& part);
	AcDbHandle NewPartEntity(Part& part);
	AcDbHandle NewEntity(Part& part);
	BOOL IsNeedRedraw();
	BOOL IsNeedMove();
	void WriteData();
	void Redraw();
	void UpdateObserver();
	void UpdateModel();
	void Move();

private:
	SHPoint* m_pSHPt;
};

#endif // !defined(AFX_PARTPOINT_H__C51C90C7_6829_4A05_A823_64C82A4A5EA7__INCLUDED_)
